package main.client;

import java.util.ArrayList;

import com.google.gwt.user.client.rpc.RemoteService;
import com.google.gwt.user.client.rpc.RemoteServiceRelativePath;

@RemoteServiceRelativePath("Project")
public interface ServerSide extends RemoteService{

	/* Init */
	String hagf();
	
	/* User handling */
	String registerUser(User user, String password);
	User validateUser(String username, String password);
	User getCurrentUser();
	String updateUser(User user, String password);
	int logout();
	int checkAdmin();
	ArrayList<User> getUsers();
	User getUser(Integer id);
	String removeUser(Integer id);
	
	/* Item handling */
	int addItem(Item item);
	Item getItem(int itemId);
	Item getPopularItem(int category);
	String removeItem(int itemId);
	ArrayList<Item> getAllItems(int category);
	ArrayList<Item> getPopular();
	
	/* Category handling */
	String addCategory(String name, int parent);
	String removeCategory(int id);
	
	/* Cart handling */
	String addCartItem(Item item);
	String removeCartItem(int itemId);
	ArrayList<Item> getCart();
	String removeCart();
	String buyItems();
	ArrayList<Cart> getCarts();
	
}
